/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simulatefire;

import java.util.InputMismatchException;
import java.util.Scanner;
import simulatefire.Building.Building;
import simulatefire.Building.Fire.Fire;

/**
 *
 * @author Nicolas
 */
public class SimulateFire {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws InterruptedException {
        
        Scanner keyboard = new Scanner(System.in);
        int choice = 0;
        Building building = null;
        Fire fire = null;
        
        try {
            while(choice != 7){

                System.out.println("Make your choice :\n 1) Create a building\n 2) Load a building\n 3) Put Fire\n 4) Simulate fire\n 5) Find Exit Path\n 6) Find Optimisations\n 7) Quit");
                choice = keyboard.nextInt();

                switch(choice){
                    case 1: building = new Building();
                            break;
                    case 2: 
                            break;
                    case 3: if(building != null){fire = new Fire(building);}
                            else{System.out.println("no building in memory");}
                            break;
                    case 4: if(fire != null){   building.printBuilding();
                                                fire.start();}
                            else{System.out.println("No fire start point");}
                            break;
                    case 5:  
                            break;
                    case 6:  
                            break;
                    default: break;
                }
            }
        }
        
        catch (InputMismatchException e) {
            System.err.println("Wrong input, program closing (error:" + e.getMessage() + ")");
        }

        /*finally{
        	keyboard.close();
        }*/
        
        /*

programme en console

enter les donn�es avec un formulaire
d�finir salles / tailles / porte / fenetre / mobilier / mati�res
load already designed building

positionner le d�part de feu en x/y/z

simuler

trouver les chemin de secours
temps de combustion total
diff�rentes positions du feu � quel moment (salle x tombe en 10 sec, salle y en 20 sec, tout le batiment en 25 sec)
trouver petites modifs � faire pour mieux s�curiser

         */
    }
}
